import GChild from "../../Core/GView/GChild";
import ShaderUtil from "../../Shaders/Manager/ShaderUtil";
import { ComonTip } from "../Common/Define";
import { VIEW_ID } from "../Common/UI";
import { Res } from "../Common/UIResources";
import GameMgr from "../Logic/GameMgr";

const { ccclass, property, menu, executeInEditMode } = cc._decorator;
@ccclass @menu('View/Home/FriendItem')

export default class FriendItem extends GChild {
    @property(cc.Sprite) icon: cc.Sprite = null;

    @property({type: cc.Node, tooltip: "按钮模块1"})  to1Btn: cc.Node = null;

    @property({type: cc.Node, tooltip: "按钮模块2"})  to2Btn: cc.Node = null;

    @property({type: cc.Node, tooltip: "按钮模块3"})  to3Btn: cc.Node = null;

    private _data: SSkillDataRaw = null;
    public setView(statu:number) {
         
        this.to1Btn.active = statu == 1;

        this.to2Btn.active = statu == 2;

        this.to3Btn.active = statu == 3;
    }

    // public setView(data: SSkillDataRaw, bool: boolean) {
    //     this._data = data;
    //     if (!bool) {
    //         ShaderUtil.gray(this.icon.node);

    //     } else {

    //     }
    //     this.assetImpl.spriteAtlasFrame(this.icon, Res.texture.views.skillIcon, data.icon.toString());
    // }

    /**点击技能详情 */
    public detailClick() {
        GameMgr.jumpToMgr.jumpGoTo(VIEW_ID.comonTipView, ComonTip.email)
    }
}